﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.Models.Bases
{
    /// <summary>
    /// 非自增长
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class BaseEntity<T>
    {
        /// <summary>
        /// 编号
        /// 主键 必填 非自增长
        /// </summary>     
        [SugarColumn(IsPrimaryKey = true,  ColumnDescription = "编号")]
        public T Id { get; set; }
    }

    /// <summary>
    /// 自增长，int型主键
    /// </summary>
    public class BaseEntity: BaseEntity<int>
    {
        /// <summary>
        /// 编号
        /// 主键 必填 自增长
        /// 默认值 0
        /// </summary>     
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "编号")]
        public int Id { get; set; }
    }   
}
